/**
 * 给定字符串S和T，将S分成w段，
 * 每一段的第c个字母连接起来是否能够组成T
 * 因为范围很小，暴力即可
 */
#include <bits/stdc++.h>
#include <bits/extc++.h>
using namespace std;

using llt = long long;
using vi = vector<int>;
using vll =vector<llt>;
using pii = pair<int, int>;
using vpii = vector<pii>;

int const INF = 3;

template<typename T>
istream & operator >> (istream & is, vector<T> & v){
	for(auto & i : v) is >> i;
	return is;
}

template<typename T>
void input(vector<T> &v, int n){
	v.assign(n + 1, {});
	for(int i=1;i<=n;++i) cin >> v[i];
	return;
}

string S, T;
int N;
int M;

bool isOK(int w, int c){
    if(S[c] != T[0]) return false;

    int k = c;
	for(auto c : T){
        if(k > N or S[k] != c) return false;
		k += w;
	}
	if(k + w > N) return true;
	return false;
}

void work(){
	cin >> S >> T;
	N = S.length();
	S = " " + S;
	M = T.length();
	for(int w=N-1;w>=1;--w){
		for(int c=1;c<=w;++c){
			if(isOK(w, c)){
				return (void)(cout << "Yes\n");
			}
		}
	}
	cout << "No\n";
    return;
}

int main() {
#ifndef ONLINE_JUDGE
    freopen("z.txt", "r", stdin);
#endif
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int nofkase = 1;
    // cin >> nofkase;
    while(nofkase--) work();
    return 0;
}